# Look in /etc/xdg for system-global autostart files
addpath('XDG_CONFIG_DIRS', '/etc/xdg')
+#
+# For Ubuntu Intrepid, libmozjs lives in /usr/lib/xulrunner-<version>/lib
+# However, that path isn't in ld.so.conf, meaning that it's basically
+# impossible to use the xulrunner .pc files and libraries. Work around
+# this by deriving the path and adding it to LD_SO_CONF ourself.
+#
+import re
+import subprocess
+_pkgconfig = subprocess.Popen(['pkg-config', '--variable=sdkdir', 'mozilla-js'],
+ stdout=subprocess.PIPE)
+_sdkdir = _pkgconfig.communicate()[0].strip()
+_pkgconfig.wait()
+if _pkgconfig.returncode == 0:
+ _libdir = re.sub('-(sdk|devel)', '', _sdkdir) + '/lib'
+ if os.path.exists(_libdir + '/libmozjs.so'):
+ addpath('LD_LIBRARY_PATH', _libdir)
+
# Rebuild faster
os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')